<template>
  <div class="father">
    <div class="biaoti">业务信息:</div><br/>
    <div class="neirong">业务id:<input class="readonly" type="text" readonly :value="service.serviceid"/></div>
    <div class="neirong">业务编号:<input class="readonly" type="text" readonly :value="service.servicenumber" /></div>
    <div class="neirong">业务类型:<input class="readonly" type="text" readonly :value="service.servicetype"/></div>
    <br/>
    <div class="biaoti">申请人基本信息:</div><br/>
    <div class="neirong">申请人:<input class="readonly" type="text" readonly :value="proposer.clientname"/></div>
    <div class="neirong">申请人身份证号码:<input class="readonly" type="text" readonly :value="proposer.idcard"/></div>
    <div class="neirong" style="padding-right: 30%">联系电话:<input class="readonly" type="text" readonly :value="proposer.phone"/></div>
    <br/>
    <div class="neirong">代理人:<input class="readonly" type="text" readonly :value="agent.clientname"/></div>
    <div class="neirong">代理人身份证号码:<input class="readonly" type="text" readonly :value="agent.idcard"/></div>
    <br/>
    <div class="biaoti">房产信息:</div><br/>
    <div class="neirong">房屋门牌号:<input class="readonly" type="text" id="roomnumber" readonly :value="room.roomnumber"/></div>
    <div class="neirong">总面积:<input class="readonly" type="text" readonly :value="building.totalarea"/></div>
    <div class="neirong"  style="padding-right: 30%">楼层:<input class="readonly" type="text" readonly :value="building.floor" /></div>
    <div class="neirong">楼栋名称:<input class="readonly" type="text" readonly :value="building.buildingname"/></div>
    <div class="neirong">楼栋编号:<input class="readonly" type="text" readonly :value="building.buildingnumber"/></div>
    <div class="neirong">分户房屋:<input class="readonly" type="text" readonly :value="building.count"/></div>

    <div class="biaoti">现房抵押信息:</div><br/>
    <div class="neirong">业务宗号:<input class="readonly" type="text" readonly :value="existmortgage.serviceid"/></div>
    <div class="neirong">一般抵押:<input class="readonly" type="text" readonly :value="existmortgage.generalmortgage"/></div>
    <div class="neirong">最高抵押:<input class="readonly" type="text" readonly :value="existmortgage.maxmortgage" /></div>
    <div class="neirong">抵押权人:<input class="readonly" type="text" readonly :value="existmortgage.mortgagee"/></div>
    <div class="neirong">抵押人:<input class="readonly" type="text" readonly :value="existmortgage.mortgager"/></div>
    <div class="neirong">债务人:<input class="readonly" type="text" readonly :value="existmortgage.debtor"/></div>
    <div class="neirong">最高债权数额:<input class="readonly" type="text" readonly :value="existmortgage.maxclaim"/></div>
    <div class="neirong">担保范围:<input class="readonly" type="text" readonly :value="existmortgage.scope"/></div>
    <div class="neirong">债务履行期限:<input class="readonly" type="text" readonly :value="existmortgage.returntime"/></div>
    <div class="neirong">登记时间:<input class="readonly" type="text" readonly :value="existmortgage.registertime"/></div>

    <div class="biaoti">文件:</div><br/>
    <div class="shuru1">登记申请书:<input class="readonly" type="text" :value="service.application" readonly/></div>
    <div class="shuru1">身份证复印件:<input class="readonly" type="text" :value="service.idcopy" readonly/></div>
    <div class="shuru1">一寸照片:<input class="readonly" type="text" :value="service.photo" readonly/></div>
    <div class="shuru1">购房发票复印件:<input class="readonly" type="text" :value="service.purchasecopy" readonly/></div>
    <div class="shuru1">购房合同复印件:<input class="readonly" type="text" :value="service.contractcopy" readonly/></div>
    <div class="shuru1">税证复印件:<input class="readonly" type="text" :value="service.taxcopy" readonly/></div>

    <div class="biaoti">审核人:<index :value="reviewer" readonly/></div><br/>
    <div class="biaoti">审核意见:<textarea :value="checker.revieweropinion" readonly></textarea></div><br/>
    <div class="biaoti">审批意见:<textarea id="yijian"></textarea></div><br/>

    <div class="shuru"><input type="button" value="提交" class="button1" @click="tijiao()"/></div>
  </div>
</template>

<script>
export default {
  name: "txqxfShenPi",
  props:['params'],
  data(){
    return{
      sid:this.params.id,
      service:{
        servicenumber: null,
        serviceid:null,
        servicetype:null,
        application: null,
        idcopy:null,
        photo: null,
        purchasecopy:null ,
        contractcopy: null,
        taxcopy: null,
      },
      proposer:{
        clientname:null,
        idcard:null,
        phone:null,
      },
      agent: {
        clientname:null,
        idcard:null,
      },
      building: {
        buildingid: null,
        buildingname: null,
        buildingnumber: null,
        floor: null,
        count: null,
        totalarea: null,
        descripe: null,
        hid: null
      },
      client:{
        clientid: null,
        clientname: null,
        address: null,
        idcard: null,
        phone: null,
        zid: null
      },
      room:{
        roomnumber:null
      },
      existmortgage: {
        emid: null,
        serviceid: null,
        generalmortgage: null,
        maxmortgage: null,
        mortgagee: null,
        mortgager: null,
        debtor: null,
        maxclaim: null,
        scope: null,
        returntime: null,
        registertime: null,
        uid: null,
        descript: null,
        roomid: null,
        cancelserviceid: null
      },
      reviewer:null,
      checker:{
        checkerid :null,
        serviceid : null,
        reviewerid :null,
        revieweropinion :null,
      }
    }
  },
  mounted() {
    this.show();
  },
  methods:{
    show(){
      this.sa.ajax("/cha/xf?serviceid="+this.sid,{},
          function (resp){
            console.log(resp);
            this.service.serviceid = resp.data.service.serviceid;
            this.service.servicenumber =  resp.data.service.servicenumber;
            this.service.servicetype = resp.data.servicetype.servicetype;
            this.service.application = resp.data.service.application;
            this.service.idcopy = resp.data.service.idcopy;
            this.service.photo = resp.data.service.photo;
            this.service.purchasecopy = resp.data.service.purchasecopy;
            this.service.contractcopy = resp.data.service.contractcopy;
            this.service.taxcopy = resp.data.service.taxcopy;
            this.proposer.clientname = resp.data.proposer.clientname;
            this.proposer.idcard = resp.data.proposer.idcard;
            this.proposer.phone = resp.data.proposer.phone;
            this.agent.clientname = resp.data.agent.clientname;
            this.agent.idcard = resp.data.agent.idcard;
            this.room.roomnumber =resp.data.room.roomnumber;
            this.building.totalarea = resp.data.building.totalarea;
            this.building.floor = resp.data.building.floor;
            this.building.buildingname = resp.data.building.buildingname;
            this.building.buildingnumber = resp.data.building.buildingnumber;
            this.building.count = resp.data.building.count;
            this.existmortgage.emid=resp.data.existmortgage.emid;
            this.existmortgage.serviceid=resp.data.existmortgage.serviceid;
            this.existmortgage.generalmortgage=resp.data.existmortgage.generalmortgage;
            this.existmortgage.maxmortgage=resp.data.existmortgage.maxmortgage;
            this.existmortgage.mortgagee=resp.data.mortgagee;
            this.existmortgage.mortgager=resp.data.mortgager;
            this.existmortgage.debtor=resp.data.existmortgage.debtor;
            this.existmortgage.maxclaim=resp.data.existmortgage.maxclaim;
            this.existmortgage.scope=resp.data.existmortgage.scope;
            this.existmortgage.returntime=resp.data.existmortgage.returntime;
            this.existmortgage.uid=resp.data.existmortgage.uid;
            this.existmortgage.descript=resp.data.existmortgage.descript;
            this.existmortgage.roomid=resp.data.existmortgage.roomid;
            this.existmortgage.cancelserviceid=resp.data.existmortgage.cancelserviceid;
            this.reviewer = resp.data.reviewer;
            this.checker.checkerid = resp.data.checker.checkerid;
            this.checker.serviceid = resp.data.checker.serviceid;
            this.checker.reviewerid = resp.data.checker.reviewerid;
            this.checker.revieweropinion = resp.data.checker.revieweropinion;

          }.bind(this),
          {type: 'get'}

      )
    },
    tijiao(){
      if($("#yijian").val()!=null){
        this.sa.ajax("/shen/shenpi?serviceid="+this.sid+"&finalrevieweropinion="+$("#yijian").val(),{},
            function(){
                alert("提交成功，已完成审核");
                var tab = {id: 'ShanZheng', name: '缮证', view: () => import('@/sa-view/jkt/ShanZheng.vue'), params: {} };
                this.sa_admin.showTab(tab);
            }.bind(this),
            {type: 'post'}
        )
         }else{
        alert("请重新检查填写信息")
      }
    }
  }
}
</script>

<style scoped>
.readonly{
  background-color: gray;
  color : white;
}
.father{
  width: 95%;
  height: 800px;
  padding-left: 5%;
}
.biaoti{
  float: left;
  padding-top: 1.5%;
  border-bottom: 1px solid black;
  width: 100%;
}
.neirong{
  float: left;
  padding-right: 2.5%;
  padding-top: 0.5%;
}
.button{
  border-radius: 10px;
  background-color: #42b983;
  color: white;
  border: 2px seagreen solid;
  width: 60px;
  height: 25px;
}
.button1{
  border-radius: 2px;
  background-color: cornflowerblue;
  color: white;
  border: 2px darkblue solid;
  width: 90px;
  height: 25px;
}
.shuru{
  float: left;
  padding-top: 1.5%;
  width: 100%;
}
.shuru1{
  float: left;
  padding-top: 1.5%;
  width: 50%;
}
</style>